<?php
function comboBox($nombre, $lista, $evento="", $idSelected="", $estilo="") {
	$onChange = "";
	if ($evento != "")
		$onChange = "onChange='$evento'";
	echo "<SELECT NAME='" . $nombre . "' class='".$estilo."' ".$onChange.">";
	if ($idSelected == "")
		$selected = " SELECTED ";
	else
		$selected = "";
	foreach ($lista as $item) {
//	if ($item[0]){
		if ($idSelected == current($item))
			$selected = " SELECTED ";
		else
			$selected = "";
		echo "<OPTION VALUE='".current($item)."' ".$selected.">";
		next ($item);
		echo current($item);
	}
	echo "</SELECT>";
}

function comboBoxSingle($nombre, $lista, $estilo="") {
	echo "<SELECT NAME='" . $nombre . "' class='".$estilo."'>";
	$selected = " SELECTED ";
	foreach ($lista  as $item)
	if ($item){
		echo "<OPTION VALUE='".$item."' ".$selected.">".$item;
		$selected = "";
	}
	echo "</SELECT>";
}

function listaMultiple($nombre, $lista, $estilo="", $size="", $multiple="", $title="") {
	$onChange = "";
	if ($evento != "")		$onChange = "onChange='$evento'";
	if ($size != "")		$size = "size='$size'";
	if ($multiple != "")	$multiple = "multiple='1'";
	if ($estilo != "")		$estilo = "class='$estilo'";
	if ($title != "")		$title = "title='$title'";

	echo "<SELECT NAME='$nombre' $estilo $size $multiple $onChange $title width=>";
	foreach ($lista as $item) {
		echo "<OPTION VALUE='".current($item)."'>";
		next ($item);
		echo current($item);
	}
	echo "</SELECT>";
}

?>